package com.jinzecloud.reportapproval.controller;

import java.util.Arrays;
import java.util.Map;

//import org.apache.shiro.authz.annotation.RequiresPermissions;
import com.jinzecloud.reportapproval.dto.Param;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import com.jinzecloud.reportapproval.bean.ReportSampleConsResults;
import com.jinzecloud.reportapproval.service.ReportSampleConsResultsService;
import com.jinzecloud.reportapproval.utils.PageUtils;
import com.jinzecloud.reportapproval.utils.R;



/**
 * 涵盖机型（或同单元机型）样品一致性检查结果
 *
 * @author æ­å°
 * @email 1971240051@qq.com
 * @date 2024-09-03 12:10:45
 */
@RestController
@RequestMapping("reportApproval/reportsampleconsresults")
@Api(tags = "涵盖机型（或同单元机型）样品一致性检查结果", description = "涵盖机型（或同单元机型）样品一致性检查结果", value = "涵盖机型（或同单元机型）样品一致性检查结果")
public class ReportSampleConsResultsController {
    @Autowired
    private ReportSampleConsResultsService reportSampleConsResultsService;

    /**
     * 列表
     */
    @RequestMapping(value = "/list",method = RequestMethod.POST)
    @ApiOperation(value = "涵盖机型（或同单元机型）样品一致性检查结果列表",notes = "涵盖机型（或同单元机型）样品一致性检查结果列表")
    //@RequiresPermissions("reportApproval:reportsampleconsresults:list")
    public R list(@RequestBody Param param){
        PageUtils page = reportSampleConsResultsService.queryPage(param);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping(value = "/info/{id}",method = RequestMethod.POST)
    @ApiOperation(value = "涵盖机型（或同单元机型）样品一致性检查结果信息",notes = "涵盖机型（或同单元机型）样品一致性检查结果信息")
    //@RequiresPermissions("reportApproval:reportsampleconsresults:info")
    public R info(@PathVariable("id") Integer id){
		ReportSampleConsResults reportSampleConsResults = reportSampleConsResultsService.getById(id);

        return R.ok().put("reportSampleConsResults", reportSampleConsResults);
    }

    /**
     * 保存
     */
    @RequestMapping(value = "/save",method = RequestMethod.POST)
    @ApiOperation(value = "涵盖机型（或同单元机型）样品一致性检查结果保存",notes = "涵盖机型（或同单元机型）样品一致性检查结果保存")
    //@RequiresPermissions("reportApproval:reportsampleconsresults:save")
    public R save(@RequestBody ReportSampleConsResults reportSampleConsResults){
		reportSampleConsResultsService.save(reportSampleConsResults);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping(value = "/update",method = RequestMethod.POST)
    @ApiOperation(value = "涵盖机型（或同单元机型）样品一致性检查结果修改",notes = "涵盖机型（或同单元机型）样品一致性检查结果修改")
    //@RequiresPermissions("reportApproval:reportsampleconsresults:update")
    public R update(@RequestBody ReportSampleConsResults reportSampleConsResults){
		reportSampleConsResultsService.updateById(reportSampleConsResults);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping(value = "/delete",method = RequestMethod.POST)
    @ApiOperation(value = "涵盖机型（或同单元机型）样品一致性检查结果删除",notes = "涵盖机型（或同单元机型）样品一致性检查结果删除")
    //@RequiresPermissions("reportApproval:reportsampleconsresults:delete")
    public R delete(@RequestBody Integer[] ids){
		reportSampleConsResultsService.removeByIds(Arrays.asList(ids));

        return R.ok();
    }

}
